<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num1 = prompt('输入数字1：');
        var num2 = prompt('输入数字2：');
        num1 = String(num1);
        num2 = String(num2);
        var num1_arr = num1.split('.');
        var num2_arr = num2.split('.');
    
        if(num1_arr[1].length < num2_arr[1].length){
            var max = num2_arr[1].length;
        }else{
            max = num1_arr[1].length;
        }
        
        //max = 2
        for(var i=1;i<max;i++){
            sum = 10*10;
        }
        var num1_sum = num1*sum;
        var num2_sum = num2*sum;
        var result = num1_sum+num2_sum;
        alert(result/sum)
        
        // console.log(num1_arr[1].length);
        // console.log(num2_arr[1].length);
        // console.log(num1+num2);
    </script>
</head>
<body>
    
</body>
</html>